import Layout from '@/layout'
export default {
    path: '/lessee',
    component: Layout,
    redirect: '/lessee',
    name: 'Lessee',
    meta: {
        title: '承租人管理',
        icon: 'clipboard',
    },
    children: [
        {
            path: 'index',
            component: () => import('@/views/lessee/index'),
            name: 'LesseeIndex',
            meta: { title: '有效承租人', icon: '' }
        },
        {
            path: 'edit/:id?/:isDisabled?',
            component: () => import('@/views/lessee/edit.vue'),
            name: 'Edit',
            beforeEnter: (to, from, next) => {
                if (to.params.id) {
                    to.meta.title = '编辑';
                    if (to.params.isDisabled ==='1') {
                        to.meta.title = '详情';
                    }
                } else {
                    to.meta.title = '新增';
                }
                next();
            },
            meta: {
                title: '新增', // 默认值
                noCache: true,
                activeMenu: `/lessee/index`
            },
            hidden: true
        },
        {
            path: 'change',
            component: () => import('@/views/lessee/change/index'),
            name: 'ChangeIndex',
            meta: { title: '已退租/变更承租人', icon: '' }
        },
        {
            path: 'change/edit/:id?/:isDisabled?',
            component: () => import('@/views/lessee/change/edit.vue'),
            name: 'ChangeEdit',
            beforeEnter: (to, from, next) => {
                if (to.params.id) {
                    to.meta.title = '编辑';
                    if (to.params.isDisabled ==='1') {
                        to.meta.title = '详情';
                    }
                } else {
                    to.meta.title = '新增';
                }
                next();
            },
            meta: {
                title: '新增', // 默认值
                noCache: true,
                activeMenu: `/lessee/change/index`
            },
            hidden: true
        }
    ]
}
